<?php

namespace App\Services\Proxy;

use GuzzleHttp\Client;

class HeeSayProxy extends _BaseProxy
{
    protected $host = 'https://pay.irisgw.com';

    public function handle()
    {
        $format = $this->method == 'GET' ? 'query' : 'json';
        return (new Client())->request($this->method, $this->host . $this->path, [
            'headers' => [
                'Content-Type' => 'application/json',
                'appid'        => $this->headers['appid'],
                'timestamp'    => $this->headers['timestamp'],
                'sign'         => $this->headers['sign'],
            ],
            'timeout' => $this->timeout,
            $format   => $this->params,
        ]);
    }
}
